home *** CD-ROM | disk | FTP | other *** search
-
-
-
- aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))) aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm))))
-
-
-
- NNNNAAAAMMMMEEEE
- alGetParams - get the values of audio resource parameters
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////aaaauuuuddddiiiioooo....hhhh>>>>
-
- iiiinnnntttt aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss((((iiiinnnntttt rrrreeeessssoooouuuurrrrcccceeee,,,, AAAALLLLppppvvvv ****ppppvvvvssss,,,, iiiinnnntttt nnnnppppvvvvssss))))
-
- PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
- _r_e_s_o_u_r_c_e
- expects the resource from which you wish to get parameter values.
-
- _p_v_s is an array of ALpv structures, each of which contains a single
- parameter and will contain the associated value upon return from
- aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss.
-
- _n_p_v_s is the number of ALpv items in the array.
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss acquires the current values for a set of parameters from a
- specific audio resource.
-
- Each parameter/value pair is represented by a single ALpv structure:
-
- typedef struct {
- int param; /* parameter */
- ALvalue value; /* value */
- short sizeIn; /* size in -- 1st dimension */
- short size2In; /* size out -- 2nd dimension */
- short sizeOut; /* size out */
- short size2Out; /* size out -- 2nd dimension */
- } ALpv;
-
-
- The application should set the _p_a_r_a_m field in each ALpv to indicate which
- parameter is of interest.
-
- For scalar parameters, this is sufficient; aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss will fill in the
- corresponding _v_a_l_u_e field.
-
- For non-scalar parameters, the application is responsible for allocating
- the memory required to hold the value. In addition to setting _p_a_r_a_m, the
- application must set the pointer field of _v_a_l_u_e (value.ptr) to point to
- the allocated buffer, and set _s_i_z_e_I_n to indicate the size of the buffer,
- in elements. aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss will write the value to the given buffer,
- filling in at most _s_i_z_e_I_n elements.
-
- aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss will set the _s_i_z_e_O_u_t field of each ALpv to indicate how many
- elements it returned. For valid scalar parameters, this is always 1. For
- non-scalar parameters, it return the number of elements available, even
- if greater than _s_i_z_e_I_n. For any parameter, it can also set _s_i_z_e_O_u_t to a
- negative value to indicate an error with that particular parameter.
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))) aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm))))
-
-
-
- alGetParams currently supports only one negative _s_i_z_e_O_u_t value:
- AL_INVALID_PARAM, which indicates that the given parameter was
- unrecognized by the given resource.
-
- See the aaaallllPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))) man page for more information on the semantics of
- particular parameters.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEE
- The following code fragment gets the value of the sample rate, the gain,
- and the name of the default audio input device.
-
- int i;
- ALpv pvs[3];
- char name[32];
- ALfixed gain[8];
-
- pvs[0].param = AL_RATE; /* a scalar parameter */
-
- pvs[1].param = AL_GAIN; /* a vector parameter */
- pvs[1].value.ptr = gain; /* the vector we've allocated */
- pvs[1].sizeIn = 8; /* the number of elements in gain */
-
- pvs[2].param = AL_NAME; /* a string parameter */
- pvs[2].value.ptr = name; /* the string we've allocated */
- pvs[2].sizeIn = 32; /* the array size, in characters,
- including space for NULL */
-
- /*
- * Now we ask the default input device for its sample rate, name,
- * and current input gain. Note that there's nothing input-specific
- * about this code. To use a default output device, we simply supply
- * AL_DEFAULT_OUTPUT as the resource to alGetParams.
- */
- if (alGetParams(AL_DEFAULT_INPUT, pvs, 3) < 0) {
- printf("alGetParams failed: %s\n", alGetErrorString(oserror()));
- }
-
- printf("name is %s, rate is %lf\n",
- name, alFixedToDouble(pvs[0].value.ll));
-
- for (i = 0; i < pvs[1].sizeOut; i++) {
- printf("gain[%d] = %lf dB\n", alFixedToDouble(gain[i]));
- }
-
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss returns the number of recognized parameters in the given PV
- list. It can also return a negative value, and set an error code, to
- indicate errors with the entire _a_l_G_e_t_P_a_r_a_m_s call. In this case, the error
- code retrieved by oooosssseeeerrrrrrrroooorrrr((((3333CCCC)))) will be one of:
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))) aaaallllGGGGeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm))))
-
-
-
- AAAALLLL____BBBBAAAADDDD____PPPPVVVVBBBBUUUUFFFFFFFFEEEERRRR
- _p_v_s is invalid.
-
- AAAALLLL____BBBBAAAADDDD____BBBBUUUUFFFFFFFFEEEERRRRLLLLEEEENNNNGGGGTTTTHHHH
- _n_p_v_s is patently wrong (e.g. negative).
-
- AAAALLLL____BBBBAAAADDDD____DDDDEEEEVVVVIIIICCCCEEEE____AAAACCCCCCCCEEEESSSSSSSS
- The audio system is inaccessible, either because it is not installed
- on the system, or because it is incorrectly configured.
-
- AAAALLLL____BBBBAAAADDDD____RRRREEEESSSSOOOOUUUURRRRCCCCEEEE
- The given resource _r_e_s_o_u_r_c_e does not exist.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- alParams(3dm), alSetParams(3dm), alGetParamInfo(3dm), oserror(3C)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-